<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>  </title>
    <style>
        div{
            width: 200px;
            height: 200px;
        }

        .c1{
            background-color: red;
            position: relative;
            left: 50px;
            top: 50px;
            z-index: -1;  /*避免覆盖*/
        }

        .c2{
            font-size: 30px;
            color: #fff;
            background-color: rgba(0, 0, 255, 0.5);  /*不透明度*/
            /* opacity: 0.5; */   /*不透明度，不常用*/
        }
    </style>
</head>
<body>
    <div class="c1"></div>
    <div class="c2">你好啊</div>
</body>
</html>